<template>
    <div ref="box" id="box" ></div>
</template>

<script>
export default {
 mounted(){
  let myChart = this.$echarts.init(this.$refs.box);
  //console.log(this.$refs.box)
  this.$http.get("reports/type/1",{headers:{"Authorization":localStorage.getItem("token")}})
  .then(res=>{
    //添加提示框的数据
    res.body.data.tooltip={
      trigger:'axis'
    }
    res.body.data.xAxis[0].boundaryGap = false
    myChart.setOption(res.body.data)
     // console.log(res.body.data)
  })
 },
 created(){
   this.$store.commit("changeTitle",{"t1":"数据统计","t2":"数据报表"})
 }
}
  
</script>

<style lang="scss" scoped>
#box{
  height: 500px;
  width:800px
}
</style>